package examination.Hisense_09_16;

import java.util.HashMap;
import java.util.Map;

public class Solution1 {
    public String handle (String str) {
        Map<Character, Integer> map = new HashMap<>();
        char[] arr = str.toCharArray();
        for (int i = 0; i < arr.length; i++) {
            map.put(arr[i], i);
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < arr.length; i++) {
            if (map.get(arr[i]) == i) {
                sb.append(arr[i]);
            }
        }
        return sb.toString();
    }
}
